//
//  JddPickSportNumTabBar.m
//  jdd
//
//  Created by Huawen Liu on 12-6-28.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddPickSportNumTabBar.h"
#import <QuartzCore/QuartzCore.h>

@implementation JddPickSportNumTabBar

@synthesize clear;
@synthesize buy;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    CAGradientLayer *gradient = [[CAGradientLayer alloc] init];
    
    gradient.frame = rect;
    
    UIColor *firstColor = [[UIColor alloc] initWithRed:252.0/255.0 green:53.0/255.0 blue:53.0/255.0 alpha:1.0];
    UIColor *secondColor = [[UIColor alloc] initWithRed:252.0/255.0 green:53.0/255.0 blue:53.0/255.0 alpha:1.0];
    UIColor *thirdColor = [[UIColor alloc] initWithRed:195.0/255.0 green:25.0/255.0 blue:17.0/255.0 alpha:1.0];
    
    gradient.colors = [NSArray arrayWithObjects:(id)firstColor.CGColor, (id)secondColor.CGColor, (id)thirdColor.CGColor, nil];
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    [gradient renderInContext:context];
    
    CGContextMoveToPoint(context,rect.origin.x, rect.origin.y);
    CGContextAddLineToPoint(context, rect.origin.x + rect.size.width, rect.origin.y);
    CGContextClosePath(context);
    CGContextStrokePath(context);
    
    clear.title = @"清空";
    clear.image = [UIImage imageNamed:@"clear.png"];
    buy.title = @"确定";
    buy.image = [UIImage imageNamed:@"check1.png"];  
}


@end